const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
    transpileDependencies: true,
    lintOnSave: false,
    pages: {
        index: {
            entry: "src/main.js"
        }
    },
    devServer: {
        proxy: {
            "/java": {
                target: "http://localhost:8081",
                pathRewrite: {"^/java" : ""},
                ws: true,
                changeOrigin: true
            },

            "/hotel": {
                target: "https://www.hotels.cn/Hotel-Search",
                pathRewrite: {"^/hotel" : ""},
                ws: true,
                changeOrigin: true
            },

            "/ai": {
                target: "https://aip.baidubce.com/oauth/2.0/token",
                pathRewrite: {"^/ai": ""},
                ws: true,
                changeOrigin: true
            },

            "/chat": {
                target: "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions",
                pathRewrite: {"^/chat": ""},
                ws: true,
                changeOrigin: true
            },

            "/map": {
                target: "https://apis.map.qq.com/ws/geocoder/v1",
                pathRewrite: {"^/map": ""},
                ws: true,
                changeOrigin: true
            },

            "/ip": {
                target: "https://ipv4.ddnspod.com/",
                pathRewrite: {"^/ip": ""},
                ws: true,
                changeOrigin: true
            },

            "/address": {
                target: "https://cn.apihz.cn/api/ip/chaapi.php",
                pathRewrite: {"^/address": ""},
                ws: true,
                changeOrigin: true
            }
        }
    }
})